package demo1;

public class Test {
    public static void DarwMap(Shape shape)
    {
        shape.draw();//这里会调用父类方法
    }
    public static void main(String[] args) {
        //Shape shape=new Shape();//抽象类不能实例化,此情况为错误

        DarwMap(new Cycle());//这里两串代码同样发生了向上转型
        DarwMap(new Rect());
    }
}
